<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" name="row[id]" value="{$row.id}">
    <input TYPE="hidden" id="row" NAME="data" VALUE='{$row|json_encode|htmlentities}'/>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text"
                value="{$row.title|htmlentities}" placeholder="请输入信息名称">
        </div>
    </div>
    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">轮插效果:</label>
        <div class="col-xs-12 col-sm-8" id="div-type">
            <select name="row[type]" id="c-type" class="form-control selectpicker" data-rule="" data-tip="轮插效果">
                <option value="1" {if $row["type"]=="1" } selected{/if}>右到左滑动</option>
                <option value="2" {if $row["type"]=="2" } selected{/if}>上到下滑动</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">图片管理:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="panel">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <i class="fa fa-images"></i> 轮播图片设置
                        <small class="text-muted">（最多可添加5张图片）</small>
                    </h4>
                </div>
                <div class="panel-body" style="padding:15px 20px;">
                    <div id="slider-images-container">
                        <!-- 动态生成的图片组将在这里显示 -->
                    </div>

                    <!-- 添加图片按钮 -->
                    <div class="text-center" style="margin-top: 15px;">
                        <button type="button" id="add-image-group" class="btn btn-success">
                            <i class="fa fa-plus"></i> 添加图片
                        </button>
                        <small class="text-muted">（已添加 <span id="image-count">0</span> / 5 张图片）</small>
                    </div>

                    <!-- 隐藏字段存储JSON数据 -->
                    <input type="hidden" id="c-image" name="row[image]" value="{$row.image|htmlentities}" />
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8" id="div-status">
            <input id="c-status" name="row[status]" type="hidden" value="{$row.status|default=1}">
            <a href="javascript:;" data-toggle="switcher"
                class="btn-switcher {if $row.status == 1}active{else}text-gray{/if}" data-input-id="c-status"
                data-yes="1" data-no="0">
                <i class="fa fa-toggle-on fa-2x {if $row.status != 1}fa-flip-horizontal{/if}"></i>
            </a>
            <div data-favisible="switch=1" class="text-primary">正常</div>
            <div data-favisible="switch=0" class="text-gray">失效</div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>